Add configurable SMT pad pair footprint - #751
Open
seveibar wants to merge 2 commits into
Open
Conversation
Comment on lines
+18
to
+50
| test("smtpadpair supports independently sized pads", () => { | ||
| const footprint = "smtpadpair_px2.1mm_ph1mm_p1w2mm_p2w1.2mm" | ||
| const circuitJson = fp.string(footprint).circuitJson() | ||
|
|
||
| expect(getPadGeometry(footprint)).toEqual([ | ||
| { x: -1.05, y: 0, width: 2, height: 1, port_hints: ["1"] }, | ||
| { x: 1.05, y: 0, width: 1.2, height: 1, port_hints: ["2"] }, | ||
| ]) | ||
| expect(convertCircuitJsonToPcbSvg(circuitJson)).toMatchSvgSnapshot( | ||
| import.meta.path, | ||
| "asymmetric", | ||
| ) | ||
| }) | ||
|
|
||
| test("smtpadpair supports a signed vertical pad offset", () => { | ||
| const footprint = "smtpadpair_px13.45mm_py-2.54mm_pw2.5mm_ph2.55mm" | ||
| const circuitJson = fp.string(footprint).circuitJson() | ||
|
|
||
| expect(getPadGeometry(footprint)).toEqual([ | ||
| { x: -6.725, y: 1.27, width: 2.5, height: 2.55, port_hints: ["1"] }, | ||
| { x: 6.725, y: -1.27, width: 2.5, height: 2.55, port_hints: ["2"] }, | ||
| ]) | ||
| expect(convertCircuitJsonToPcbSvg(circuitJson)).toMatchSvgSnapshot( | ||
| import.meta.path, | ||
| "staggered", | ||
| ) | ||
| }) | ||
|
|
||
| test("smtpadpair rejects coincident pads", () => { | ||
| expect(() => fp.string("smtpadpair_px0mm_py0mm").circuitJson()).toThrow( | ||
| "non-zero center offset", | ||
| ) | ||
| }) |
Contributor
There was a problem hiding this comment.
This file contains three test(...) calls (at lines 18, 32, and 46), but the rule states that a *.test.ts file may have AT MOST one test(...). The additional tests should be split into separate, numbered files — for example: smtpadpair1.test.ts, smtpadpair2.test.ts, and smtpadpair3.test.ts.
Spotted by Graphite (based on custom rule: Custom rule)
Is this helpful? React 👍 or 👎 to let us know.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Benchmark impact
The corresponding circuit-json-to-footprinter matcher improves the jlc5000 95% IoU benchmark from 471/600 (78.50%) to 483/600 (80.50%), recovering all 12 rectangular two-pad misses.
Testing